#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
int n,a[maxn],m=0,ans=0;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;++i){
        int x;
        scanf("%d",&x);
        a[x]++;
        m=max(m,x);
    }
    for(int i=1;i<=m;++i){
        if(a[i]==0) continue;
        int sum=a[i];
        for(int j=i-1;j>=1;j--){
            if(sum<=0) break;
            if(a[j]==0) continue;
            if(sum>=a[j]){
                sum-=a[j];
                a[j]=0;
            }else{
                a[j]-=sum;
                sum=0;
            }
        }
    }
    for(int i=1;i<=m;++i) ans+=a[i];
    cout<<ans<<"\n";
    return 0;
}
